<include file="Common/header" />
<title>房卡添加</title>
</head>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-user-character-add">
		<input type="hidden" name="eid" id="eid" value="{$info['id']}" />
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">* </span>房间编号：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text radius" value="{$info['roomnumber']}" placeholder="" id="room_number" name="room_number" datatype="*4-16" nullmsg="">
			</div>
			<label class="form-label col-2"><span class="c-red">* </span>设备类型：</label>
			<div class="formControls col-4">
				<span class="select-box radius">
					<select class="select radius" size="1" name="typeid" id="typeid">
						<option value="1" <?php echo $info['typeid'] == 1 ? 'selected' : ''; ?>>水表</option>
						<option value="2" <?php echo $info['typeid'] == 2 ? 'selected' : ''; ?>>电表</option>
						<option value="3" <?php echo $info['typeid'] == 3 ? 'selected' : ''; ?>>气表</option>
					</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">* </span>计量设备ID：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text radius" value="{$info['eqmnumber']}" placeholder="" id="eqmnumber" name="eqmnumber" datatype="*4-16" nullmsg="">
			</div>
			<label class="form-label col-2"><span class="c-red">* </span>原始起数：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text radius" value="{$info['start_number']}" placeholder="" id="start_number" name="start_number" datatype="*4-16" nullmsg="">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">* </span>费率：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text radius" value="{$info['rates']}" placeholder="" id="rates" name="rates" datatype="*4-16" nullmsg="">
			</div>
			<label class="form-label col-2"><span class="c-red">* </span>设备编号：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text radius" value="{$info['eqmid']}" placeholder="" id="eqmid" name="eqmid" datatype="*4-16" nullmsg="">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">* </span>指令1：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text radius" value="{$info['comd']}" placeholder="" id="comd" name="comd" datatype="*4-16" nullmsg="">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">* </span>指令2：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text radius" value="{$info['comd2']}" placeholder="" id="comd2" name="comd2" datatype="*4-16" nullmsg="">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">* </span>指令3：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text radius" value="{$info['comd3']}" placeholder="" id="comd3" name="comd3" datatype="*4-16" nullmsg="">
			</div>
		</div>
		
		<div class="row cl">
			<div class="col-10 col-offset-5">
				<button type="button" class="btn btn-success radius" id="admin-role-save" name="admin-role-save"><i class="icon-ok"></i> 确定</button>
			</div>
		</div>
	</form>
</div>
<script>
	$(document).ready(function(){
		$(".btn-success").on('click', function(){
			var load = layer.load(2);
			$.post('index.html', $("#form-user-character-add").serialize(), function(data){
				layer.close(load);
				if(data == '编辑成功'){
					layer.msg(data, {icon: 1, time: 2000}, function(){
						location.reload();
					});
				}else{
					layer.msg(data, {icon: 2, time: 2000});
				}
			});
		});
	});
</script>
</body>
</html>